#pragma once

#include "Widget.h"




namespace Gui
{
	class Button abstract : public Widget
	{
	protected:

		notification   m_clicked;
		notification   m_doubleClicked;
		notification   m_gainedFocus;
		notification   m_lostFocus;

	public:

		connector<notification>   clicked;
		connector<notification>   doubleClicked;
		connector<notification>   gainedFocus;
		connector<notification>   lostFocus;

	public:

		Button(Widget* parent, const std::wstring& className, const std::wstring& caption, math::int2 pos, math::int2 size, int style);
		virtual ~Button();

	protected:

		/**
		 * Calculate the optimal size of this button.
		 */
		math::int2 optimalSize() const;

		virtual LRESULT msgProc(UINT msg, WPARAM wParam, LPARAM lParam);
	};
	///////////////////////////////////////////////////////////////////////////////////////////////
}
///////////////////////////////////////////////////////////////////////////////////////////////////
